package top.dancun.easteacher.feign.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import top.dancun.common.entity.UserEntity;
import top.dancun.common.utils.R;
import top.dancun.easteacher.entity.UserRoleEntity;
import top.dancun.easteacher.feign.SysFeign;

import java.util.Objects;

@Component
public class SysFeignService {
    @Autowired
    SysFeign sysFeign;

    public boolean saveUser(UserEntity user){
        R r = sysFeign.saveUser(user);
        if (Objects.equals(r.get("code").toString(),"20000")){
            return true;
        }
        return false;
    }
    public boolean saveUserRole(UserRoleEntity userRole){
        R r = sysFeign.saveUserRole(userRole);
        if (Objects.equals(r.get("code").toString(),"20000")){
            return true;
        }
        return false;
    }
}
